<?php
/**
 * Created by JetBrains PhpStorm.
 * User: patch
 * Date: 07.12.12
 * Time: 2:16
 * To change this template use File | Settings | File Templates.
 */

/**
 * @return string
 */
function company_discounts_overview_page_callback() {
  return '';
}

/**
 * @return string
 */
function discounts_overview_page_callback() {
  $nids = array();
  $nodes = discounts_load_multiple($nids, array('status' => 1));

  $out = '';
  if($nodes) {
    $views = node_view_multiple($nodes, 'overview');

    $out = '<div class="row">' . render($views) . '</div>';
    $out .= theme('pager');

  }

  return render($out);
}

/**
 * @param $node
 * @return string
 */
function discount_page_callback($node) {

  if(!$node || $node->type != DISCOUNT_NODE_TYPE) {
    drupal_not_found();
  }

  $view  = '';
  $view .= node_view($node, 'full');

  return render($view);
}

/**
 * @param $node
 * @return string
 */
function discount_comments_page_callback($node) {

  if(!$node || $node->type != DISCOUNT_NODE_TYPE) {
    drupal_not_found();
  }

  $view  = '';
  $view .= node_view($node, 'comments');

  return render($view);
}



/**
 * @return string
 */
function discount_reviews_page_callback($node) {

  if(!$node || $node->type != DISCOUNT_NODE_TYPE) {
    drupal_not_found();
  }

  $view  = '';
  $view .= node_view($node, 'reviews');

  return render($view);
}

/**
 * @return string
 */
function discount_map_page_callback($node) {

  if(!$node || $node->type != DISCOUNT_NODE_TYPE) {
    drupal_not_found();
  }


  $view = node_view($node, 'map');

  return render($view);
}

/**
 * @return string
 */
function discount_add() {
  return '';
}


/**
 * @param $node
 * @return string
 */
function discount_edit($node) {
  return '';
}

/**
 * @param $node
 * @return string
 */
function discount_delete($node) {
  return '';
}

